// $Id: niortsp.h 88 2011-10-17 18:00:11Z cedric.shih@gmail.com $
/*
 * Copyright 2011 Cedric Shih (cedric dot shih at gmail dot com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef NIORTSP_H_
#define NIORTSP_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/types.h>
#include <stdio.h>

const char *niortsp_get_version(void);

/**
 * @brief Log levels.
 */
enum niortsp_log_level {
	NIORTSP_TRACE, /**< Trivial step tracing log. */
	NIORTSP_DEBUG, /**< Debugging log. */
	NIORTSP_INFO, /**< Informative log. */
	NIORTSP_WARN, /**< Warning log. */
	NIORTSP_ERROR, /**< Error log. */
	NIORTSP_FATAL, /**< Fatal error log. */
};

/**
 * @brief Prototype of logger function.
 *
 * @param level - log level
 * @param func - function name
 * @param line - line number
 * @param message - log message
 */
typedef void (*niortsp_logger_cb)(int level,
		const char *func, unsigned int line, const char *message,
		void *arg);

/**
 * @brief Set logger function.
 *
 * @param cb - logger function
 * @see niortsp_logger_cb
 */
void niortsp_logger_set(niortsp_logger_cb cb, void *arg);

#ifdef __cplusplus
}
#endif

#endif /* NIORTSP_H_ */
